<?
$rtime 		= microtime();
$rtime 		= explode(" ",$rtime);
$rtime 		= $rtime[1] + $rtime[0];
$start_rb 	= $rtime;

require_once '../core/config.php';//System Config...
require_once '../core/FunctionLib.php';  //System Init...
require_once '../core/Curl.php';  //System Init...
//require_once '../core/Init.php';  //System Init...

global $server_list;

if(isset($_GET['del_c']) && (int)$_GET['del_c']==2010){
	FunctionLib::empty_all_dir(DIR_CACHE,true,true);
	echo 'done';
}
else{
	if($server_list){
		foreach ($server_list as $server){
			$link = "http://{$server}tools/delcache.php?del_c=2010";
			$curl = new CURL();
			$return = $curl->get($link);
			if($return == 'done'){
				echo "run service in $link<br>";					
			}
			else{
				echo "error in $link<br>";
			}
		}
		
		$mtime = microtime();
		$mtime = explode(" ",$mtime);
		$mtime = $mtime[1] + $mtime[0];
		$end_rb = $mtime;			
		$page_load_time = round(($end_rb - $start_rb),5)."s";
		
		echo "Done in $page_load_time". "<br>";
	}
} 
?>
